using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AutoSet : MonoBehaviour {

    public GameObject CellBack;
    public Transform PlayerField;
    public float Scale;
    public float Black;
    public float Row;
    public float Column;

    //public GameObject ColumnButton;
    //public Transform ButtonField;
        
    public void SetCellBack()
    {
        float x = (-Scale - Black) * (Column - 1) / 2;
        float y =(Scale + Black) * (Row - 1) / 2;
        Vector3 startPosition = new Vector3(x, y, 0);

        for (int i = 0; i < Row; i++)
        {
            for (int j = 0; j < Column; j++)
            {
                GameObject temp = Instantiate(CellBack, PlayerField);
                temp.transform.position = startPosition + new Vector3(Scale * j + Black * j, -Scale * i - Black * i, 0);
                temp.transform.localScale = new Vector3(Scale, Scale, 1);
            }
        }
    }
        

}
	